#!/usr/bin/python
#Calculation of the current year date is in how many days
class Numbers_day(object):
    def __init__(self):
        self.L = [31,28,31,30,31,30,31,31,30,31,30,31]

    def leap_year(self,year):
        if year%4 == 0 and year%100 != 0:
            return True
        elif year%400 == 0 :
            return True
        else:
            return False

    def data_num(self,year,month,day): 
        L = self.L
        s = 0
        s = sum(L[0:month-1])+day
        if self.leap_year(year) and month >2:
            s += 1
        return s

if __name__ == "__main__":
    num = Numbers_day()
    year = int(raw_input("Please enter the year:"))
    month = int(raw_input("Please enter the month:"))
    day = int(raw_input("Please enter the day:"))
    print num.data_num(year,month,day)
else:
    pass
